
  ██████╗ ██████╗ ██╗   ██╗███████╗    
 ██╔═══██╗██╔══██╗██║   ██║██╔════╝    
 ██║   ██║██████╔╝██║   ██║███████╗    
 ██║   ██║██╔═══╝ ██║   ██║╚════██║    
 ╚██████╔╝██║     ╚██████╔╝███████║    
  ╚═════╝ ╚═╝      ╚═════╝ ╚══════╝    

                                  
CONTENTS OF THIS FILE
---------------------
 * Introduction
 * Requirements
 * Installation
 * Configuration
 * Project Contents
 * FAQ
 * About



INTRODUCTION
------------
The following contains the source files for the revamped Intranet system for Opus International Consultants Ltd.



REQUIREMENTS
------------
 * A local webserver running PHP5 and above (https://www.apachefriends.org/index.html)
 * A MySQL Database (https://www.apachefriends.org/index.html)
 * (Recommended) browser support for HTML5, CSS3, JavaScript



INSTALLATION
------------
 * Download and Install XAMPP in a location of your choice, such as "C:\xampp".
 * After installation has completed, select the "Do you want to start the Control Panel now?" checkbox open or manually open the XAMPP control panel
 * Click start and enable the Apache and MySQL servers
 * Try going to "http://localhost" or "127.0.0.1" to see if you can see the XAMPP logo and select your language as English
 * Copy the contents of the "upload/" folder in this directory, to "C:\xampp\htdocs\"
 * Navigate to "http://localhost/index.php" and see if you can view the Opus page with the navigation buttons.
 * For more help (https://www.udemy.com/blog/xampp-tutorial/)



CONFIGURATION
-------------
 * Once you see the Opus page after installing, you need to set up the MySQL database.
 * In the XAMPP control panel, next to MySQL, click "Admin"
 * You should be redirected to the phpMyAdmin control panel
 * You will see on the same page there is a "Create new Database" field
 * Enter the name for the database as "needa_opusdb"
 * Ensure the database was created successfully by waiting for the success message
 * By default, the username for this database is root and the password is blank (there is none)
 * Go to the "Users" section of phpMyAdmin
 * Create a new user with the username "needa_opus"
 * Use the password "opuSSuloSid123"
 * Click the next button and you will be asked to set the user rights
 * Check all the boxes, so the user has rights to do everything
 * Click next and the user should be created 
 * On the same users page there should be an option to add users to a database
 * Add the user "needa_opus" to the database "needa_opusdb"
 * Ensure this has completed successfully, else the connections will not work
 * Finally you need to populate the database with data. Select the database "needa_opusdb"
 * Click the "Import" button at the top of the page
 * In the "browse for a file", section. Browse to the "needa_opusdb.sql" file in this directory
 * Ensure partial import is checked, and the format is "SQL"
 * Click Go, and wait for the data to be imported. This could take a few minutes
 * Ensure the data was imported successfully by waiting for the success message
 * Configuration is complete
 * To check this has worked go to "http://localhost/profile" and see if you can see the user "John Smith" and details about him
 * If this process was successful, it is recommended to delete the .sql file for security purposes

The details for the database can be changed in the future, however the source code files are currently configured to connect to a database with the following details.
This connection is usually at the top of each PHP file and looks similar to this:

   
        mysql_connect("localhost", "needa_opus", "opuSSuloSid123")
            or die("Could not connect: " . mysql_error());
        mysql_select_db("needa_opusdb");


It is recommended you change the details of the database and user, such as the name, username and password
The easiest way to do this is to perform a simple find and replace on all the files to change this information



PROJECT CONTENTS
-------------
The following contain pages:
 * localhost/maps - The standalone mapping application for viewing an overview of people and projects.
 * localhost/funding - The form where users submit applications for technical funding
 * localhost/funding/admin.php - The management panel to view funding applications and generate graphs from the statistics
 * localhost/profile/ - The page where a users profile can be viewed
 * localhost/profile/?id=25 - View the profile of user #25
 * localhost/publications/ - Publications search of a person
 
Other folders
 * localhost/css - contains some CSS files
 * localhost/dataTables - the DataTables plugin used on the technical funding admin page
 * localhost/forms - an initial test page for demoing autocomplete functionality
 * localhost/js - contains the JavaScript files for the DataTables and Flot plugin, both used on the technical funding admin page
 * localhost/locationextract - the unfinished algorithm for extracting location information from projects
 * localhost/map - the map overlayed  when the static map is clicked on the profile page
 * localhost/orangebox - the OrangeBox plugin files used for creating overlay popup windows
 * localhost/profile_old - the existing profile page from Opus's intranet system
 * localhost/search - a test page at trying to use the new header and footer on Opus's search page.
 * localhost/theme - contains an empty page with theme used on all of the created intranet pages
 * localhost/token-input - the Token Input library used for listboxes on the profile page
 
Other files of interest
 * localhost/iepngfix.htc - used to help fix errors when viewing images in IE
 * localhost/header.php - the header for the theme to be included in all pages
 * localhost/leaguegothic-regular-webfont.tff - the embedded font used for headings in the theme
 * localhost/opus_cgi_styles.css - the stylesheet of the existing intranet system
 * localhost/pencil-head-sid.cur - a custom cursor I created that was meant to be used when hovering over an EDITABLE field
 
 

FAQ
-------------
Can I delete the contents of the \profile\uploads\avatars folder?
 * Yes, you can. However the references to these profile images from the database will be broken.
 * You will need to change the links in the database to reference a placeholder image.

Can I then also delete the contents of the \funding\uploads\pdf folder? 
 * Again, yes you can. However the links to the uploaded PDFs will be broken and will need to be updated.
 
I updated the OrangeBox/MarkerClusterer library and now I'm getting errors?
 * This is because both these libraries source files have been modified to suit the project. 
 * If you do wish to update these source files, you will need to copy and paste the custom methods and data across.
 * You can look at the original source of these libraries (for the same version) to see what has been changed before copying.

The website isn't rendering correctly in Internet Explorer 9?
 * The site supports IE9 itself, and any newer versions.
 * A common reason could be due having console.log statements in parts of the source file.
 * Try reloading the page with the developer tools open and seeing if it renders correctly. This is the most common fix.
 * If the above doesn't work, ensure the embedded fonts and style sheets have the correct permissions to be accessed.

How do I create a new page? 
 * Make a new .php file and use the following code:
 
		<?php include 'header.php';?>
			//site content goes here
		<?php include 'footer.php';?>
 
 
 
ABOUT
-------------
This project was created by Sid Jotsingani for Opus International Consultants Ltd, for BTech 451 at The University of Auckland.
The Supervisors for this project were Dr. Sulo Shanmuganathan, Dr. Xinfeng Ye.
The co-ordinator for BTech 451 was Dr. Sathiamoorthy Manoharan.


